package com.uzai.console.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.uzai.console.dto.pyq.hdkgoods.PyqHdkGoodsQuery;
import com.uzai.console.entity.PyqHdkGoods;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;

/**
 * 朋友圈好单库商品
 */
@Repository
public interface PyqHdkGoodsMapper {
    int deleteById(Long id);

    int deleteBeforeDay(int beforeDay);

    int insert(PyqHdkGoods record);

    int insertSelective(PyqHdkGoods record);

    PyqHdkGoods selectById(Long id);

    PyqHdkGoods selectByItemidAndAddDay(@Param("itemid") String itemid, @Param("addDay") String addDay);

    /**
     * @author liuqi
     * @param addDay --入库天数
     * @param goodsIdList  --不在商品列表当中
     * @return com.uzai.console.entity.PyqHdkGoods
     */
    PyqHdkGoods selectNewest(@Param("addDay") String addDay, @Param("goodsIdList") List<Long> goodsIdList);

    int updateByIdSelective(PyqHdkGoods record);

    int updateById(PyqHdkGoods record);

    /**
     * 分页查询
     * @param page
     * @param query
     * @return
     */
    ArrayList<PyqHdkGoods> findByList(Page<PyqHdkGoods> page, @Param("query") PyqHdkGoodsQuery query);

    /**
     * 查询所有
     * @param query
     * @return
     */
    ArrayList<PyqHdkGoods> findByList(@Param("query") PyqHdkGoodsQuery query);
}